Integrand size = 38, antiderivative size = 155 \[ \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{(a+b \cos (c+d x))^2} \, dx=\frac {(b B-2 a C) x}{b^3}-\frac {2 a \left (a^2 b B-2 b^3 B-2 a^3 C+3 a b^2 C\right ) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} b^3 (a+b)^{3/2} d}+\frac {C \sin (c+d x)}{b^2 d}-\frac {a^2 (b B-a C) \sin (c+d x)}{b^2 \left (a^2-b^2\right ) d (a+b \cos (c+d x))} \]
(B*b-2*C*a)*x/b^3-2*a*(B*a^2*b-2*B*b^3-2*C*a^3+3*C*a*b^2)*arctan((a-b)^(1/ 2)*tan(1/2*d*x+1/2*c)/(a+b)^(1/2))/(a-b)^(3/2)/b^3/(a+b)^(3/2)/d+C*sin(d*x +c)/b^2/d-a^2*(B*b-C*a)*sin(d*x+c)/b^2/(a^2-b^2)/d/(a+b*cos(d*x+c))
Time = 1.74 (sec) , antiderivative size = 147, normalized size of antiderivative = 0.95 \[ \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{(a+b \cos (c+d x))^2} \, dx=\frac {(b B-2 a C) (c+d x)+\frac {2 a \left (-a^2 b B+2 b^3 B+2 a^3 C-3 a b^2 C\right ) \text {arctanh}\left (\frac {(a-b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {-a^2+b^2}}\right )}{\left (-a^2+b^2\right )^{3/2}}+b C \sin (c+d x)+\frac {a^2 b (-b B+a C) \sin (c+d x)}{(a-b) (a+b) (a+b \cos (c+d x))}}{b^3 d} \]
((b*B - 2*a*C)*(c + d*x) + (2*a*(-(a^2*b*B) + 2*b^3*B + 2*a^3*C - 3*a*b^2* C)*ArcTanh[((a - b)*Tan[(c + d*x)/2])/Sqrt[-a^2 + b^2]])/(-a^2 + b^2)^(3/2 ) + b*C*Sin[c + d*x] + (a^2*b*(-(b*B) + a*C)*Sin[c + d*x])/((a - b)*(a + b )*(a + b*Cos[c + d*x])))/(b^3*d)
Time = 0.96 (sec) , antiderivative size = 185, normalized size of antiderivative = 1.19, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.289, Rules used = {3042, 3508, 3042, 3467, 3042, 3502, 3042, 3214, 3042, 3138, 218}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{(a+b \cos (c+d x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin \left (c+d x+\frac {\pi }{2}\right ) \left (B \sin \left (c+d x+\frac {\pi }{2}\right )+C \sin \left (c+d x+\frac {\pi }{2}\right )^2\right )}{\left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^2}dx\) |
\(\Big \downarrow \) 3508 |
\(\displaystyle \int \frac {\cos ^2(c+d x) (B+C \cos (c+d x))}{(a+b \cos (c+d x))^2}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin \left (c+d x+\frac {\pi }{2}\right )^2 \left (B+C \sin \left (c+d x+\frac {\pi }{2}\right )\right )}{\left (a+b \sin \left (c+d x+\frac {\pi }{2}\right )\right )^2}dx\) |
\(\Big \downarrow \) 3467 |
\(\displaystyle \frac {\int \frac {b \left (a^2-b^2\right ) C \cos ^2(c+d x)+\left (a^2-b^2\right ) (b B-a C) \cos (c+d x)+a b (b B-a C)}{a+b \cos (c+d x)}dx}{b^2 \left (a^2-b^2\right )}-\frac {a^2 (b B-a C) \sin (c+d x)}{b^2 d \left (a^2-b^2\right ) (a+b \cos (c+d x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {b \left (a^2-b^2\right ) C \sin \left (c+d x+\frac {\pi }{2}\right )^2+\left (a^2-b^2\right ) (b B-a C) \sin \left (c+d x+\frac {\pi }{2}\right )+a b (b B-a C)}{a+b \sin \left (c+d x+\frac {\pi }{2}\right )}dx}{b^2 \left (a^2-b^2\right )}-\frac {a^2 (b B-a C) \sin (c+d x)}{b^2 d \left (a^2-b^2\right ) (a+b \cos (c+d x))}\) |
\(\Big \downarrow \) 3502 |
\(\displaystyle \frac {\frac {\int \frac {a (b B-a C) b^2+\left (a^2-b^2\right ) (b B-2 a C) \cos (c+d x) b}{a+b \cos (c+d x)}dx}{b}+\frac {C \left (a^2-b^2\right ) \sin (c+d x)}{d}}{b^2 \left (a^2-b^2\right )}-\frac {a^2 (b B-a C) \sin (c+d x)}{b^2 d \left (a^2-b^2\right ) (a+b \cos (c+d x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {\int \frac {a (b B-a C) b^2+\left (a^2-b^2\right ) (b B-2 a C) \sin \left (c+d x+\frac {\pi }{2}\right ) b}{a+b \sin \left (c+d x+\frac {\pi }{2}\right )}dx}{b}+\frac {C \left (a^2-b^2\right ) \sin (c+d x)}{d}}{b^2 \left (a^2-b^2\right )}-\frac {a^2 (b B-a C) \sin (c+d x)}{b^2 d \left (a^2-b^2\right ) (a+b \cos (c+d x))}\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle \frac {\frac {x \left (a^2-b^2\right ) (b B-2 a C)-a \left (-2 a^3 C+a^2 b B+3 a b^2 C-2 b^3 B\right ) \int \frac {1}{a+b \cos (c+d x)}dx}{b}+\frac {C \left (a^2-b^2\right ) \sin (c+d x)}{d}}{b^2 \left (a^2-b^2\right )}-\frac {a^2 (b B-a C) \sin (c+d x)}{b^2 d \left (a^2-b^2\right ) (a+b \cos (c+d x))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {x \left (a^2-b^2\right ) (b B-2 a C)-a \left (-2 a^3 C+a^2 b B+3 a b^2 C-2 b^3 B\right ) \int \frac {1}{a+b \sin \left (c+d x+\frac {\pi }{2}\right )}dx}{b}+\frac {C \left (a^2-b^2\right ) \sin (c+d x)}{d}}{b^2 \left (a^2-b^2\right )}-\frac {a^2 (b B-a C) \sin (c+d x)}{b^2 d \left (a^2-b^2\right ) (a+b \cos (c+d x))}\) |
\(\Big \downarrow \) 3138 |
\(\displaystyle \frac {\frac {x \left (a^2-b^2\right ) (b B-2 a C)-\frac {2 a \left (-2 a^3 C+a^2 b B+3 a b^2 C-2 b^3 B\right ) \int \frac {1}{(a-b) \tan ^2\left (\frac {1}{2} (c+d x)\right )+a+b}d\tan \left (\frac {1}{2} (c+d x)\right )}{d}}{b}+\frac {C \left (a^2-b^2\right ) \sin (c+d x)}{d}}{b^2 \left (a^2-b^2\right )}-\frac {a^2 (b B-a C) \sin (c+d x)}{b^2 d \left (a^2-b^2\right ) (a+b \cos (c+d x))}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {\frac {C \left (a^2-b^2\right ) \sin (c+d x)}{d}+\frac {x \left (a^2-b^2\right ) (b B-2 a C)-\frac {2 a \left (-2 a^3 C+a^2 b B+3 a b^2 C-2 b^3 B\right ) \arctan \left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d \sqrt {a-b} \sqrt {a+b}}}{b}}{b^2 \left (a^2-b^2\right )}-\frac {a^2 (b B-a C) \sin (c+d x)}{b^2 d \left (a^2-b^2\right ) (a+b \cos (c+d x))}\) |
-((a^2*(b*B - a*C)*Sin[c + d*x])/(b^2*(a^2 - b^2)*d*(a + b*Cos[c + d*x]))) + (((a^2 - b^2)*(b*B - 2*a*C)*x - (2*a*(a^2*b*B - 2*b^3*B - 2*a^3*C + 3*a *b^2*C)*ArcTan[(Sqrt[a - b]*Tan[(c + d*x)/2])/Sqrt[a + b]])/(Sqrt[a - b]*S qrt[a + b]*d))/b + ((a^2 - b^2)*C*Sin[c + d*x])/d)/(b^2*(a^2 - b^2))
3.9.2.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[b*(x/d), x] - Simp[(b*c - a*d)/d Int[1/(c + d *Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^2*((A_.) + (B_.)*sin[(e_.) + (f _.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[ (B*c - A*d)*(b*c - a*d)^2*Cos[e + f*x]*((c + d*Sin[e + f*x])^(n + 1)/(f*d^2 *(n + 1)*(c^2 - d^2))), x] - Simp[1/(d^2*(n + 1)*(c^2 - d^2)) Int[(c + d* Sin[e + f*x])^(n + 1)*Simp[d*(n + 1)*(B*(b*c - a*d)^2 - A*d*(a^2*c + b^2*c - 2*a*b*d)) - ((B*c - A*d)*(a^2*d^2*(n + 2) + b^2*(c^2 + d^2*(n + 1))) + 2* a*b*d*(A*c*d*(n + 2) - B*(c^2 + d^2*(n + 1))))*Sin[e + f*x] - b^2*B*d*(n + 1)*(c^2 - d^2)*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B} , x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && LtQ[ n, -1]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Co s[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Simp[1/(b*(m + 2)) Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] && !LtQ[m, -1]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_ .) + (f_.)*(x_)]^2), x_Symbol] :> Simp[1/b^2 Int[(a + b*Sin[e + f*x])^(m + 1)*(c + d*Sin[e + f*x])^n*(b*B - a*C + b*C*Sin[e + f*x]), x], x] /; FreeQ [{a, b, c, d, e, f, A, B, C, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[A*b^2 - a*b*B + a^2*C, 0]
Time = 1.13 (sec) , antiderivative size = 205, normalized size of antiderivative = 1.32
method | result | size |
derivativedivides | \(\frac {-\frac {2 a \left (\frac {a b \left (B b -a C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a +b \right )}+\frac {\left (B \,a^{2} b -2 B \,b^{3}-2 C \,a^{3}+3 C a \,b^{2}\right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{3}}+\frac {\frac {2 C b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}+2 \left (B b -2 a C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{3}}}{d}\) | \(205\) |
default | \(\frac {-\frac {2 a \left (\frac {a b \left (B b -a C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) a -b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a +b \right )}+\frac {\left (B \,a^{2} b -2 B \,b^{3}-2 C \,a^{3}+3 C a \,b^{2}\right ) \arctan \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {\left (a -b \right ) \left (a +b \right )}}\right )}{b^{3}}+\frac {\frac {2 C b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )}+2 \left (B b -2 a C \right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{3}}}{d}\) | \(205\) |
risch | \(\frac {B x}{b^{2}}-\frac {2 a C x}{b^{3}}-\frac {i C \,{\mathrm e}^{i \left (d x +c \right )}}{2 b^{2} d}+\frac {i C \,{\mathrm e}^{-i \left (d x +c \right )}}{2 b^{2} d}+\frac {2 i a^{2} \left (-B b +a C \right ) \left (a \,{\mathrm e}^{i \left (d x +c \right )}+b \right )}{b^{3} \left (a^{2}-b^{2}\right ) d \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}+2 a \,{\mathrm e}^{i \left (d x +c \right )}+b \right )}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) B}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) d \,b^{2}}+\frac {2 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) B}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) d}+\frac {2 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) C}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) d \,b^{3}}-\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) C}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) d b}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) B}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) d \,b^{2}}-\frac {2 a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) B}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) d}-\frac {2 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) C}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) d \,b^{3}}+\frac {3 a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+a \sqrt {-a^{2}+b^{2}}}{b \sqrt {-a^{2}+b^{2}}}\right ) C}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right ) d b}\) | \(818\) |
1/d*(-2*a/b^3*(a*b*(B*b-C*a)/(a^2-b^2)*tan(1/2*d*x+1/2*c)/(tan(1/2*d*x+1/2 *c)^2*a-b*tan(1/2*d*x+1/2*c)^2+a+b)+(B*a^2*b-2*B*b^3-2*C*a^3+3*C*a*b^2)/(a -b)/(a+b)/((a-b)*(a+b))^(1/2)*arctan((a-b)*tan(1/2*d*x+1/2*c)/((a-b)*(a+b) )^(1/2)))+2/b^3*(C*b*tan(1/2*d*x+1/2*c)/(1+tan(1/2*d*x+1/2*c)^2)+(B*b-2*C* a)*arctan(tan(1/2*d*x+1/2*c))))
Leaf count of result is larger than twice the leaf count of optimal. 359 vs. \(2 (148) = 296\).
Time = 0.33 (sec) , antiderivative size = 788, normalized size of antiderivative = 5.08 \[ \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{(a+b \cos (c+d x))^2} \, dx=\left [-\frac {2 \, {\left (2 \, C a^{5} b - B a^{4} b^{2} - 4 \, C a^{3} b^{3} + 2 \, B a^{2} b^{4} + 2 \, C a b^{5} - B b^{6}\right )} d x \cos \left (d x + c\right ) + 2 \, {\left (2 \, C a^{6} - B a^{5} b - 4 \, C a^{4} b^{2} + 2 \, B a^{3} b^{3} + 2 \, C a^{2} b^{4} - B a b^{5}\right )} d x + {\left (2 \, C a^{5} - B a^{4} b - 3 \, C a^{3} b^{2} + 2 \, B a^{2} b^{3} + {\left (2 \, C a^{4} b - B a^{3} b^{2} - 3 \, C a^{2} b^{3} + 2 \, B a b^{4}\right )} \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) + {\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (a \cos \left (d x + c\right ) + b\right )} \sin \left (d x + c\right ) - a^{2} + 2 \, b^{2}}{b^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + a^{2}}\right ) - 2 \, {\left (2 \, C a^{5} b - B a^{4} b^{2} - 3 \, C a^{3} b^{3} + B a^{2} b^{4} + C a b^{5} + {\left (C a^{4} b^{2} - 2 \, C a^{2} b^{4} + C b^{6}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{4} b^{4} - 2 \, a^{2} b^{6} + b^{8}\right )} d \cos \left (d x + c\right ) + {\left (a^{5} b^{3} - 2 \, a^{3} b^{5} + a b^{7}\right )} d\right )}}, -\frac {{\left (2 \, C a^{5} b - B a^{4} b^{2} - 4 \, C a^{3} b^{3} + 2 \, B a^{2} b^{4} + 2 \, C a b^{5} - B b^{6}\right )} d x \cos \left (d x + c\right ) + {\left (2 \, C a^{6} - B a^{5} b - 4 \, C a^{4} b^{2} + 2 \, B a^{3} b^{3} + 2 \, C a^{2} b^{4} - B a b^{5}\right )} d x - {\left (2 \, C a^{5} - B a^{4} b - 3 \, C a^{3} b^{2} + 2 \, B a^{2} b^{3} + {\left (2 \, C a^{4} b - B a^{3} b^{2} - 3 \, C a^{2} b^{3} + 2 \, B a b^{4}\right )} \cos \left (d x + c\right )\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \cos \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \sin \left (d x + c\right )}\right ) - {\left (2 \, C a^{5} b - B a^{4} b^{2} - 3 \, C a^{3} b^{3} + B a^{2} b^{4} + C a b^{5} + {\left (C a^{4} b^{2} - 2 \, C a^{2} b^{4} + C b^{6}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{{\left (a^{4} b^{4} - 2 \, a^{2} b^{6} + b^{8}\right )} d \cos \left (d x + c\right ) + {\left (a^{5} b^{3} - 2 \, a^{3} b^{5} + a b^{7}\right )} d}\right ] \]
[-1/2*(2*(2*C*a^5*b - B*a^4*b^2 - 4*C*a^3*b^3 + 2*B*a^2*b^4 + 2*C*a*b^5 - B*b^6)*d*x*cos(d*x + c) + 2*(2*C*a^6 - B*a^5*b - 4*C*a^4*b^2 + 2*B*a^3*b^3 + 2*C*a^2*b^4 - B*a*b^5)*d*x + (2*C*a^5 - B*a^4*b - 3*C*a^3*b^2 + 2*B*a^2 *b^3 + (2*C*a^4*b - B*a^3*b^2 - 3*C*a^2*b^3 + 2*B*a*b^4)*cos(d*x + c))*sqr t(-a^2 + b^2)*log((2*a*b*cos(d*x + c) + (2*a^2 - b^2)*cos(d*x + c)^2 + 2*s qrt(-a^2 + b^2)*(a*cos(d*x + c) + b)*sin(d*x + c) - a^2 + 2*b^2)/(b^2*cos( d*x + c)^2 + 2*a*b*cos(d*x + c) + a^2)) - 2*(2*C*a^5*b - B*a^4*b^2 - 3*C*a ^3*b^3 + B*a^2*b^4 + C*a*b^5 + (C*a^4*b^2 - 2*C*a^2*b^4 + C*b^6)*cos(d*x + c))*sin(d*x + c))/((a^4*b^4 - 2*a^2*b^6 + b^8)*d*cos(d*x + c) + (a^5*b^3 - 2*a^3*b^5 + a*b^7)*d), -((2*C*a^5*b - B*a^4*b^2 - 4*C*a^3*b^3 + 2*B*a^2* b^4 + 2*C*a*b^5 - B*b^6)*d*x*cos(d*x + c) + (2*C*a^6 - B*a^5*b - 4*C*a^4*b ^2 + 2*B*a^3*b^3 + 2*C*a^2*b^4 - B*a*b^5)*d*x - (2*C*a^5 - B*a^4*b - 3*C*a ^3*b^2 + 2*B*a^2*b^3 + (2*C*a^4*b - B*a^3*b^2 - 3*C*a^2*b^3 + 2*B*a*b^4)*c os(d*x + c))*sqrt(a^2 - b^2)*arctan(-(a*cos(d*x + c) + b)/(sqrt(a^2 - b^2) *sin(d*x + c))) - (2*C*a^5*b - B*a^4*b^2 - 3*C*a^3*b^3 + B*a^2*b^4 + C*a*b ^5 + (C*a^4*b^2 - 2*C*a^2*b^4 + C*b^6)*cos(d*x + c))*sin(d*x + c))/((a^4*b ^4 - 2*a^2*b^6 + b^8)*d*cos(d*x + c) + (a^5*b^3 - 2*a^3*b^5 + a*b^7)*d)]
Timed out. \[ \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{(a+b \cos (c+d x))^2} \, dx=\text {Timed out} \]
Exception generated. \[ \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{(a+b \cos (c+d x))^2} \, dx=\text {Exception raised: ValueError} \]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?` f or more de
Leaf count of result is larger than twice the leaf count of optimal. 1116 vs. \(2 (148) = 296\).
Time = 0.43 (sec) , antiderivative size = 1116, normalized size of antiderivative = 7.20 \[ \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{(a+b \cos (c+d x))^2} \, dx=\text {Too large to display} \]
((4*C*a^6*b^2 - 2*B*a^5*b^3 - 2*C*a^5*b^3 + B*a^4*b^4 - 9*C*a^4*b^4 + 5*B* a^3*b^5 + 4*C*a^3*b^5 - 2*B*a^2*b^6 + 5*C*a^2*b^6 - 3*B*a*b^7 - 2*C*a*b^7 + B*b^8 + 2*C*a^3*abs(-a^2*b^3 + b^5) - B*a^2*b*abs(-a^2*b^3 + b^5) - C*a^ 2*b*abs(-a^2*b^3 + b^5) + B*a*b^2*abs(-a^2*b^3 + b^5) - 2*C*a*b^2*abs(-a^2 *b^3 + b^5) + B*b^3*abs(-a^2*b^3 + b^5))*(pi*floor(1/2*(d*x + c)/pi + 1/2) + arctan(2*sqrt(1/2)*tan(1/2*d*x + 1/2*c)/sqrt((2*a^3*b^2 - 2*a*b^4 + sqr t(-4*(a^3*b^2 + a^2*b^3 - a*b^4 - b^5)*(a^3*b^2 - a^2*b^3 - a*b^4 + b^5) + 4*(a^3*b^2 - a*b^4)^2))/(a^3*b^2 - a^2*b^3 - a*b^4 + b^5))))/(a^3*b^2*abs (-a^2*b^3 + b^5) - a*b^4*abs(-a^2*b^3 + b^5) + (a^2*b^3 - b^5)^2) + ((a^2* b - a*b^2 - b^3)*sqrt(a^2 - b^2)*B*abs(-a^2*b^3 + b^5)*abs(-a + b) - (2*a^ 3 - a^2*b - 2*a*b^2)*sqrt(a^2 - b^2)*C*abs(-a^2*b^3 + b^5)*abs(-a + b) - ( 2*a^5*b^3 - a^4*b^4 - 5*a^3*b^5 + 2*a^2*b^6 + 3*a*b^7 - b^8)*sqrt(a^2 - b^ 2)*B*abs(-a + b) + (4*a^6*b^2 - 2*a^5*b^3 - 9*a^4*b^4 + 4*a^3*b^5 + 5*a^2* b^6 - 2*a*b^7)*sqrt(a^2 - b^2)*C*abs(-a + b))*(pi*floor(1/2*(d*x + c)/pi + 1/2) + arctan(2*sqrt(1/2)*tan(1/2*d*x + 1/2*c)/sqrt((2*a^3*b^2 - 2*a*b^4 - sqrt(-4*(a^3*b^2 + a^2*b^3 - a*b^4 - b^5)*(a^3*b^2 - a^2*b^3 - a*b^4 + b ^5) + 4*(a^3*b^2 - a*b^4)^2))/(a^3*b^2 - a^2*b^3 - a*b^4 + b^5))))/((a^2*b ^3 - b^5)^2*(a^2 - 2*a*b + b^2) - (a^5*b^2 - 2*a^4*b^3 + 2*a^2*b^5 - a*b^6 )*abs(-a^2*b^3 + b^5)) + 2*(2*C*a^3*tan(1/2*d*x + 1/2*c)^3 - B*a^2*b*tan(1 /2*d*x + 1/2*c)^3 - C*a^2*b*tan(1/2*d*x + 1/2*c)^3 - C*a*b^2*tan(1/2*d*...
Time = 6.95 (sec) , antiderivative size = 3276, normalized size of antiderivative = 21.14 \[ \int \frac {\cos (c+d x) \left (B \cos (c+d x)+C \cos ^2(c+d x)\right )}{(a+b \cos (c+d x))^2} \, dx=\text {Too large to display} \]
(log(tan(c/2 + (d*x)/2) + 1i)*(B*b - 2*C*a)*1i)/(b^3*d) - ((2*tan(c/2 + (d *x)/2)^3*(B*a^2*b - C*b^3 - 2*C*a^3 + C*a*b^2 + C*a^2*b))/(b^2*(a + b)*(a - b)) + (2*tan(c/2 + (d*x)/2)*(C*b^3 - 2*C*a^3 + B*a^2*b + C*a*b^2 - C*a^2 *b))/(b^2*(a + b)*(a - b)))/(d*(a + b + tan(c/2 + (d*x)/2)^4*(a - b) + 2*a *tan(c/2 + (d*x)/2)^2)) - (log(tan(c/2 + (d*x)/2) - 1i)*(B*b*1i - C*a*2i)) /(b^3*d) - (a*atan(((a*(-(a + b)^3*(a - b)^3)^(1/2)*((32*tan(c/2 + (d*x)/2 )*(B^2*b^8 + 8*C^2*a^8 - 2*B^2*a*b^7 - 8*C^2*a^7*b + 3*B^2*a^2*b^6 + 4*B^2 *a^3*b^5 - 5*B^2*a^4*b^4 - 2*B^2*a^5*b^3 + 2*B^2*a^6*b^2 + 4*C^2*a^2*b^6 - 8*C^2*a^3*b^5 + 5*C^2*a^4*b^4 + 16*C^2*a^5*b^3 - 16*C^2*a^6*b^2 - 4*B*C*a *b^7 - 8*B*C*a^7*b + 8*B*C*a^2*b^6 - 8*B*C*a^3*b^5 - 16*B*C*a^4*b^4 + 18*B *C*a^5*b^3 + 8*B*C*a^6*b^2))/(a*b^6 + b^7 - a^2*b^5 - a^3*b^4) + (a*((32*( B*a^2*b^10 - B*b^12 - 3*B*a^3*b^9 + B*a^5*b^7 - 3*C*a^2*b^10 - 3*C*a^3*b^9 + 5*C*a^4*b^8 + C*a^5*b^7 - 2*C*a^6*b^6 + 2*B*a*b^11 + 2*C*a*b^11))/(a*b^ 8 + b^9 - a^2*b^7 - a^3*b^6) - (32*a*tan(c/2 + (d*x)/2)*(-(a + b)^3*(a - b )^3)^(1/2)*(2*B*b^3 + 2*C*a^3 - B*a^2*b - 3*C*a*b^2)*(2*a*b^11 - 2*a^2*b^1 0 - 4*a^3*b^9 + 4*a^4*b^8 + 2*a^5*b^7 - 2*a^6*b^6))/((a*b^6 + b^7 - a^2*b^ 5 - a^3*b^4)*(b^9 - 3*a^2*b^7 + 3*a^4*b^5 - a^6*b^3)))*(-(a + b)^3*(a - b) ^3)^(1/2)*(2*B*b^3 + 2*C*a^3 - B*a^2*b - 3*C*a*b^2))/(b^9 - 3*a^2*b^7 + 3* a^4*b^5 - a^6*b^3))*(2*B*b^3 + 2*C*a^3 - B*a^2*b - 3*C*a*b^2)*1i)/(b^9 - 3 *a^2*b^7 + 3*a^4*b^5 - a^6*b^3) + (a*(-(a + b)^3*(a - b)^3)^(1/2)*((32*...